#
# MAINTAINER        Carson,C.J.Zeong <zcy@nicescale.com>
# DOCKER-VERSION    1.6.2
#
# Dockerizing Mariadb: Dockerfile for building Mariadb images
#
#存在继承关系，基于构建的centos7.1的镜像来进行构建
FROM csphere/centos:7.1
MAINTAINER Carson,C.J.Zeong <zcy@nicescale.com>

#设置DATA_DIR的环境变量
ENV DATA_DIR /var/lib/mysql

# Install Mariadb
RUN yum install -y mariadb mariadb-server && \
    yum clean all

ADD mysqld_charset.cnf /etc/my.cnf.d/

COPY scripts /scripts
RUN chmod +x /scripts/start

EXPOSE 3306

#表示要将containner的/var/lib/mysql映射都宿主机里面去
VOLUME ["/var/lib/mysql"]

ENTRYPOINT ["/scripts/start"]
